Repository navigation
Reject a prebuilt addon whose ABI does not match at load time (#62) - #63
Merged
Merged
Conversation
addonBuildInfo() now also reports the KernelParamsV2 size the kernel reads. loadNativeAddon() throws when the addon lacks the export (v0.1.0 and v0.1.1 prebuilts), or when its version, pack revision or KernelParamsV2 size differs from the package, instead of warning and failing deep inside a trace.
Merged
anxuanng
added a commit
to codepawl/crucible
that referenced
this pull request
Nov 17, 2026
55f2448d is the v0.2.0 tag commit. It contains 9fd3f722 (the session geometry update this PR needs) and codepawl/cook#63, which rejects a stale prebuilt addon at load time.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #62
loadNativeAddon()now rejects a prebuilt addon that does not match the package, at load time, instead of letting a trace fail deep in the kernel with "KernelParamsV2 must be 320 bytes, got 336".addonBuildInfo()also reportskernelParamsBytes, taken from theKERNEL_PARAMS_V2_BYTESconstant the kernel checks.compareAddonBuildInfocompares version, pack revision and KernelParamsV2 size with the JS side (PACK_REVISION,STRUCT_STRIDES_V2.kernelParams).How I checked it
node --test: 181 pass, 0 fail.verifyAddonBuildInfonever throws): 5 of the 8 tests intests/addon-handshake.test.mjsfail (missing export, size mismatch, unreported size, version mismatch, revision mismatch). Restored: all pass.engine.test.mjsandjs-surface-validation.test.mjsnow export a matchingaddonBuildInfo(tests/support/fake-addon.mjs).pub(crate)constant.cargo checkcannot run on this Windows machine (napi-build needs libnode.dll), so the Rust build andtools/check-addon-build-info.mjsrun in CI.Evidence
Before, with a v0.1.1 addon: no error at load, then mid-trace
KernelParamsV2 must be 320 bytes, got 336.After:
An addon with another size:
the addon reads KernelParamsV2 blocks of 320 bytes and the package writes 336 bytes.